<template>
    <view class="flex-start-center item-box" v-for="item in PropsData.data" :key="item.c_guid" @click="onClickNews(item)">
        <view class="left">
            <span class="point" v-show="item.c_rev_status == 'N'"></span>
            <image :src="item.imgGuid ? item.imgGuid : '../../../static/img/home_qyxw.png'" mode="aspectFill" class="image" @error="onError(item)"/>
        </view>
        <view class="right flex-column-between">
            <view class="text-ellipsis sub_title">{{item.c_title}}</view>
            <view class="text-ellipsis sub_des">{{item.littleTitle}}</view>
            <view class="text-ellipsis tertiary_des">{{ item.c_mk_dt }}</view>
        </view>
    </view>
    <view v-if="PropsData.data.length == 0" class="no-data">
        <image src="@/static/img/no_data.png" mode="aspectFit" class="image" />
    </view>
</template>  
<script setup lang="ts">
/**
 *  新闻模块
 */

 import { ref, defineProps } from 'vue';
 let PropsData = defineProps(['data'])


 const onClickNews = (item) => {
    console.log('点击了', item);
	uni.navigateTo({
		url: '/pages/OaViews/News/NewsDetail?item='+JSON.stringify(item)
	});
}

 const onError = (item) => {
    console.log('错误了', item);
    item.imgGuid = '../../../static/img/home_qyxw.png';
}


</script>
  
<style lang="scss" scoped>

.item-box {
    margin-top: 28px;
    margin-bottom: 20px;
}
.left {
    position: relative;
    width: 80px;
    height: 60px;
    border-radius: 5px;
    .point {
        position: absolute;
        top: -2px;
        right: -2px;
    }   
    .image {
        width: 100%;
        height: 100%;
        border-radius: 5px;
        object-fit: cover;
    }
}
.right {
    flex: 1;
    width: 0;
    height: 120rpx;
    margin-left: 20rpx;
}


</style>